package com.wizz.trade.trading.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;

import lombok.Getter;
import lombok.Setter;
import net.bytebuddy.asm.Advice;

/**
 * <p>
 * 持仓表
 * </p>
 *
 * @author fyftless
 * @since 2023-04-23 04:37:04
 */
@Getter
@Setter
@TableName("position")
public class Position implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "Id", type = IdType.AUTO)
    private Integer id;

    /**
     * 日期
     */
    @TableField("date")
    private LocalDate date;

    /**
     * 本公司账套简称
     */
    @TableField("ledger")
    private Integer ledger;

    /**
     * 本公司部门名称
     */
    @TableField("ourdept")
    private Integer ourDept;

    /**
     * 贸易商
     */
    @TableField("company")
    private Integer company;

    /**
     * 贸易商部门
     */
    @TableField("companydept")
    private Integer companyDept;

    /**
     * 品种
     */
    @TableField("variety")
    private Integer variety;

    /**
     * 规格
     */
    @TableField("grade")
    private Integer grade;

    /**
     * 商标
     */
    @TableField("trademark")
    private Integer trademark;

    /**
     * 含税成本价
     */
    @TableField("cprice")
    private BigDecimal cprice;

    /**
     * 不含税成本价
     */
    @TableField("ptcprice")
    private BigDecimal ptcprice;

    /**
     * 对应币种结算价 currency settle price
     */
    @TableField("sprice")
    private BigDecimal sprice;

    /**
     * 币种
     */
    @TableField("currency")
    private Integer currency;

    /**
     * 持仓量
     */
    @TableField("oi")
    private BigDecimal oi;

    /**
     * 现货浮动盈亏 floating profit loss =(对应币种结算价 sprice-成本价 cprice)*持仓量 ol
     */
    @TableField("fpl")
    private BigDecimal fpl;

    /**
     * 应占用库存资金 storage_capital =cost_price*oi
     */
    @TableField("storage_capital")
    private BigDecimal storageCapital;

    /**
     * 批次号
     */
    @TableField("batch_no")
    private String batchNo;

    /**
     * 贸易类型
     */
    @TableField("pattern")
    private Integer pattern;

    /**
     * 交货方式
     */
    @TableField("deliver")
    private Integer deliver;

    /**
     * 订单模式
     */
    @TableField("order_id")
    private Integer orderId;

    /**
     * 数量单位
     */
    @TableField("unit")
    private String unit;

}
